\(\int \frac {(a+b x+c x^2)^3}{(d+e x) (f+g x)} \, dx\) [816]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 27, antiderivative size = 531 \[ \int \frac {\left (a+b x+c x^2\right )^3}{(d+e x) (f+g x)} \, dx=-\frac {\left (b^2 e^3 g^3 (b e f+b d g-3 a e g)-c^3 \left (e^4 f^4+d e^3 f^3 g+d^2 e^2 f^2 g^2+d^3 e f g^3+d^4 g^4\right )-3 c e^2 g^2 \left (a^2 e^2 g^2-2 a b e g (e f+d g)+b^2 \left (e^2 f^2+d e f g+d^2 g^2\right )\right )-3 c^2 e g \left (a e g \left (e^2 f^2+d e f g+d^2 g^2\right )-b \left (e^3 f^3+d e^2 f^2 g+d^2 e f g^2+d^3 g^3\right )\right )\right ) x}{e^5 g^5}+\frac {\left (b^3 e^3 g^3-3 b c e^2 g^2 (b e f+b d g-2 a e g)-c^3 \left (e^3 f^3+d e^2 f^2 g+d^2 e f g^2+d^3 g^3\right )-3 c^2 e g \left (a e g (e f+d g)-b \left (e^2 f^2+d e f g+d^2 g^2\right )\right )\right ) x^2}{2 e^4 g^4}+\frac {c \left (3 b^2 e^2 g^2-3 c e g (b e f+b d g-a e g)+c^2 \left (e^2 f^2+d e f g+d^2 g^2\right )\right ) x^3}{3 e^3 g^3}-\frac {c^2 (c e f+c d g-3 b e g) x^4}{4 e^2 g^2}+\frac {c^3 x^5}{5 e g}+\frac {\left (c d^2-b d e+a e^2\right )^3 \log (d+e x)}{e^6 (e f-d g)}-\frac {\left (c f^2-b f g+a g^2\right )^3 \log (f+g x)}{g^6 (e f-d g)} \]

[Out]

-(b^2*e^3*g^3*(-3*a*e*g+b*d*g+b*e*f)-c^3*(d^4*g^4+d^3*e*f*g^3+d^2*e^2*f^2*g^2+d*e^3*f^3*g+e^4*f^4)-3*c*e^2*g^2
*(a^2*e^2*g^2-2*a*b*e*g*(d*g+e*f)+b^2*(d^2*g^2+d*e*f*g+e^2*f^2))-3*c^2*e*g*(a*e*g*(d^2*g^2+d*e*f*g+e^2*f^2)-b*
(d^3*g^3+d^2*e*f*g^2+d*e^2*f^2*g+e^3*f^3)))*x/e^5/g^5+1/2*(b^3*e^3*g^3-3*b*c*e^2*g^2*(-2*a*e*g+b*d*g+b*e*f)-c^
3*(d^3*g^3+d^2*e*f*g^2+d*e^2*f^2*g+e^3*f^3)-3*c^2*e*g*(a*e*g*(d*g+e*f)-b*(d^2*g^2+d*e*f*g+e^2*f^2)))*x^2/e^4/g
^4+1/3*c*(3*b^2*e^2*g^2-3*c*e*g*(-a*e*g+b*d*g+b*e*f)+c^2*(d^2*g^2+d*e*f*g+e^2*f^2))*x^3/e^3/g^3-1/4*c^2*(-3*b*
e*g+c*d*g+c*e*f)*x^4/e^2/g^2+1/5*c^3*x^5/e/g+(a*e^2-b*d*e+c*d^2)^3*ln(e*x+d)/e^6/(-d*g+e*f)-(a*g^2-b*f*g+c*f^2
)^3*ln(g*x+f)/g^6/(-d*g+e*f)

Rubi [A] (verified)

Time = 0.56 (sec) , antiderivative size = 531, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.037, Rules used = {907} \[ \int \frac {\left (a+b x+c x^2\right )^3}{(d+e x) (f+g x)} \, dx=-\frac {x \left (-3 c e^2 g^2 \left (a^2 e^2 g^2-2 a b e g (d g+e f)+b^2 \left (d^2 g^2+d e f g+e^2 f^2\right )\right )+b^2 e^3 g^3 (-3 a e g+b d g+b e f)-3 c^2 e g \left (a e g \left (d^2 g^2+d e f g+e^2 f^2\right )-b \left (d^3 g^3+d^2 e f g^2+d e^2 f^2 g+e^3 f^3\right )\right )-\left (c^3 \left (d^4 g^4+d^3 e f g^3+d^2 e^2 f^2 g^2+d e^3 f^3 g+e^4 f^4\right )\right )\right )}{e^5 g^5}+\frac {x^2 \left (-3 c^2 e g \left (a e g (d g+e f)-b \left (d^2 g^2+d e f g+e^2 f^2\right )\right )-3 b c e^2 g^2 (-2 a e g+b d g+b e f)+b^3 e^3 g^3-\left (c^3 \left (d^3 g^3+d^2 e f g^2+d e^2 f^2 g+e^3 f^3\right )\right )\right )}{2 e^4 g^4}+\frac {c x^3 \left (-3 c e g (-a e g+b d g+b e f)+3 b^2 e^2 g^2+c^2 \left (d^2 g^2+d e f g+e^2 f^2\right )\right )}{3 e^3 g^3}+\frac {\log (d+e x) \left (a e^2-b d e+c d^2\right )^3}{e^6 (e f-d g)}-\frac {\log (f+g x) \left (a g^2-b f g+c f^2\right )^3}{g^6 (e f-d g)}-\frac {c^2 x^4 (-3 b e g+c d g+c e f)}{4 e^2 g^2}+\frac {c^3 x^5}{5 e g} \]

[In]

Int[(a + b*x + c*x^2)^3/((d + e*x)*(f + g*x)),x]

[Out]

-(((b^2*e^3*g^3*(b*e*f + b*d*g - 3*a*e*g) - c^3*(e^4*f^4 + d*e^3*f^3*g + d^2*e^2*f^2*g^2 + d^3*e*f*g^3 + d^4*g
^4) - 3*c*e^2*g^2*(a^2*e^2*g^2 - 2*a*b*e*g*(e*f + d*g) + b^2*(e^2*f^2 + d*e*f*g + d^2*g^2)) - 3*c^2*e*g*(a*e*g
*(e^2*f^2 + d*e*f*g + d^2*g^2) - b*(e^3*f^3 + d*e^2*f^2*g + d^2*e*f*g^2 + d^3*g^3)))*x)/(e^5*g^5)) + ((b^3*e^3
*g^3 - 3*b*c*e^2*g^2*(b*e*f + b*d*g - 2*a*e*g) - c^3*(e^3*f^3 + d*e^2*f^2*g + d^2*e*f*g^2 + d^3*g^3) - 3*c^2*e
*g*(a*e*g*(e*f + d*g) - b*(e^2*f^2 + d*e*f*g + d^2*g^2)))*x^2)/(2*e^4*g^4) + (c*(3*b^2*e^2*g^2 - 3*c*e*g*(b*e*
f + b*d*g - a*e*g) + c^2*(e^2*f^2 + d*e*f*g + d^2*g^2))*x^3)/(3*e^3*g^3) - (c^2*(c*e*f + c*d*g - 3*b*e*g)*x^4)
/(4*e^2*g^2) + (c^3*x^5)/(5*e*g) + ((c*d^2 - b*d*e + a*e^2)^3*Log[d + e*x])/(e^6*(e*f - d*g)) - ((c*f^2 - b*f*
g + a*g^2)^3*Log[f + g*x])/(g^6*(e*f - d*g))

Rule 907

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :
> Int[ExpandIntegrand[(d + e*x)^m*(f + g*x)^n*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] &
& NeQ[e*f - d*g, 0] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && I
ntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {-b^2 e^3 g^3 (b e f+b d g-3 a e g)+c^3 \left (e^4 f^4+d e^3 f^3 g+d^2 e^2 f^2 g^2+d^3 e f g^3+d^4 g^4\right )+3 c e^2 g^2 \left (a^2 e^2 g^2-2 a b e g (e f+d g)+b^2 \left (e^2 f^2+d e f g+d^2 g^2\right )\right )+3 c^2 e g \left (a e g \left (e^2 f^2+d e f g+d^2 g^2\right )-b \left (e^3 f^3+d e^2 f^2 g+d^2 e f g^2+d^3 g^3\right )\right )}{e^5 g^5}+\frac {\left (b^3 e^3 g^3-3 b c e^2 g^2 (b e f+b d g-2 a e g)-c^3 \left (e^3 f^3+d e^2 f^2 g+d^2 e f g^2+d^3 g^3\right )-3 c^2 e g \left (a e g (e f+d g)-b \left (e^2 f^2+d e f g+d^2 g^2\right )\right )\right ) x}{e^4 g^4}+\frac {c \left (3 b^2 e^2 g^2-3 c e g (b e f+b d g-a e g)+c^2 \left (e^2 f^2+d e f g+d^2 g^2\right )\right ) x^2}{e^3 g^3}-\frac {c^2 (c e f+c d g-3 b e g) x^3}{e^2 g^2}+\frac {c^3 x^4}{e g}+\frac {\left (c d^2-b d e+a e^2\right )^3}{e^5 (e f-d g) (d+e x)}+\frac {\left (c f^2-b f g+a g^2\right )^3}{g^5 (-e f+d g) (f+g x)}\right ) \, dx \\ & = -\frac {\left (b^2 e^3 g^3 (b e f+b d g-3 a e g)-c^3 \left (e^4 f^4+d e^3 f^3 g+d^2 e^2 f^2 g^2+d^3 e f g^3+d^4 g^4\right )-3 c e^2 g^2 \left (a^2 e^2 g^2-2 a b e g (e f+d g)+b^2 \left (e^2 f^2+d e f g+d^2 g^2\right )\right )-3 c^2 e g \left (a e g \left (e^2 f^2+d e f g+d^2 g^2\right )-b \left (e^3 f^3+d e^2 f^2 g+d^2 e f g^2+d^3 g^3\right )\right )\right ) x}{e^5 g^5}+\frac {\left (b^3 e^3 g^3-3 b c e^2 g^2 (b e f+b d g-2 a e g)-c^3 \left (e^3 f^3+d e^2 f^2 g+d^2 e f g^2+d^3 g^3\right )-3 c^2 e g \left (a e g (e f+d g)-b \left (e^2 f^2+d e f g+d^2 g^2\right )\right )\right ) x^2}{2 e^4 g^4}+\frac {c \left (3 b^2 e^2 g^2-3 c e g (b e f+b d g-a e g)+c^2 \left (e^2 f^2+d e f g+d^2 g^2\right )\right ) x^3}{3 e^3 g^3}-\frac {c^2 (c e f+c d g-3 b e g) x^4}{4 e^2 g^2}+\frac {c^3 x^5}{5 e g}+\frac {\left (c d^2-b d e+a e^2\right )^3 \log (d+e x)}{e^6 (e f-d g)}-\frac {\left (c f^2-b f g+a g^2\right )^3 \log (f+g x)}{g^6 (e f-d g)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.26 (sec) , antiderivative size = 476, normalized size of antiderivative = 0.90 \[ \int \frac {\left (a+b x+c x^2\right )^3}{(d+e x) (f+g x)} \, dx=-\frac {e g x \left (-30 b^2 e^3 g^3 (e f-d g) (6 a e g+b (-2 e f-2 d g+e g x))+c^3 \left (60 d^5 g^5-30 d^4 e g^5 x+20 d^3 e^2 g^5 x^2-15 d^2 e^3 g^5 x^3+12 d e^4 g^5 x^4+e^5 f \left (-60 f^4+30 f^3 g x-20 f^2 g^2 x^2+15 f g^3 x^3-12 g^4 x^4\right )\right )-30 c e^2 g^2 (e f-d g) \left (6 a^2 e^2 g^2+6 a b e g (-2 e f-2 d g+e g x)+b^2 \left (6 d^2 g^2-3 d e g (-2 f+g x)+e^2 \left (6 f^2-3 f g x+2 g^2 x^2\right )\right )\right )+15 c^2 e g \left (-2 a e g (e f-d g) \left (6 d^2 g^2-3 d e g (-2 f+g x)+e^2 \left (6 f^2-3 f g x+2 g^2 x^2\right )\right )+b \left (-12 d^4 g^4+6 d^3 e g^4 x-4 d^2 e^2 g^4 x^2+3 d e^3 g^4 x^3+e^4 f \left (12 f^3-6 f^2 g x+4 f g^2 x^2-3 g^3 x^3\right )\right )\right )\right )-60 \left (c d^2+e (-b d+a e)\right )^3 g^6 \log (d+e x)+60 e^6 \left (c f^2+g (-b f+a g)\right )^3 \log (f+g x)}{60 e^6 g^6 (e f-d g)} \]

[In]

Integrate[(a + b*x + c*x^2)^3/((d + e*x)*(f + g*x)),x]

[Out]

-1/60*(e*g*x*(-30*b^2*e^3*g^3*(e*f - d*g)*(6*a*e*g + b*(-2*e*f - 2*d*g + e*g*x)) + c^3*(60*d^5*g^5 - 30*d^4*e*
g^5*x + 20*d^3*e^2*g^5*x^2 - 15*d^2*e^3*g^5*x^3 + 12*d*e^4*g^5*x^4 + e^5*f*(-60*f^4 + 30*f^3*g*x - 20*f^2*g^2*
x^2 + 15*f*g^3*x^3 - 12*g^4*x^4)) - 30*c*e^2*g^2*(e*f - d*g)*(6*a^2*e^2*g^2 + 6*a*b*e*g*(-2*e*f - 2*d*g + e*g*
x) + b^2*(6*d^2*g^2 - 3*d*e*g*(-2*f + g*x) + e^2*(6*f^2 - 3*f*g*x + 2*g^2*x^2))) + 15*c^2*e*g*(-2*a*e*g*(e*f -
 d*g)*(6*d^2*g^2 - 3*d*e*g*(-2*f + g*x) + e^2*(6*f^2 - 3*f*g*x + 2*g^2*x^2)) + b*(-12*d^4*g^4 + 6*d^3*e*g^4*x
- 4*d^2*e^2*g^4*x^2 + 3*d*e^3*g^4*x^3 + e^4*f*(12*f^3 - 6*f^2*g*x + 4*f*g^2*x^2 - 3*g^3*x^3)))) - 60*(c*d^2 +
e*(-(b*d) + a*e))^3*g^6*Log[d + e*x] + 60*e^6*(c*f^2 + g*(-(b*f) + a*g))^3*Log[f + g*x])/(e^6*g^6*(e*f - d*g))

Maple [A] (verified)

Time = 0.64 (sec) , antiderivative size = 837, normalized size of antiderivative = 1.58

method result size
norman \(\frac {\left (3 a^{2} c \,e^{4} g^{4}+3 a \,b^{2} e^{4} g^{4}-6 a b c d \,e^{3} g^{4}-6 a b c \,e^{4} f \,g^{3}+3 a \,c^{2} d^{2} e^{2} g^{4}+3 a \,c^{2} d \,e^{3} f \,g^{3}+3 a \,c^{2} e^{4} f^{2} g^{2}-b^{3} d \,e^{3} g^{4}-b^{3} e^{4} f \,g^{3}+3 b^{2} c \,d^{2} e^{2} g^{4}+3 b^{2} c d \,e^{3} f \,g^{3}+3 b^{2} c \,e^{4} f^{2} g^{2}-3 b \,c^{2} d^{3} e \,g^{4}-3 b \,c^{2} d^{2} e^{2} f \,g^{3}-3 b \,c^{2} d \,e^{3} f^{2} g^{2}-3 b \,c^{2} e^{4} f^{3} g +c^{3} d^{4} g^{4}+c^{3} d^{3} e f \,g^{3}+c^{3} d^{2} e^{2} f^{2} g^{2}+c^{3} d \,e^{3} f^{3} g +c^{3} e^{4} f^{4}\right ) x}{e^{5} g^{5}}+\frac {c^{3} x^{5}}{5 e g}+\frac {\left (6 a b c \,e^{3} g^{3}-3 a \,c^{2} d \,e^{2} g^{3}-3 a \,c^{2} e^{3} f \,g^{2}+b^{3} e^{3} g^{3}-3 b^{2} c d \,e^{2} g^{3}-3 b^{2} c \,e^{3} f \,g^{2}+3 b \,c^{2} d^{2} e \,g^{3}+3 b \,c^{2} d \,e^{2} f \,g^{2}+3 b \,c^{2} e^{3} f^{2} g -c^{3} d^{3} g^{3}-c^{3} d^{2} e f \,g^{2}-c^{3} d \,e^{2} f^{2} g -c^{3} e^{3} f^{3}\right ) x^{2}}{2 e^{4} g^{4}}+\frac {c \left (3 a c \,e^{2} g^{2}+3 b^{2} e^{2} g^{2}-3 b c d e \,g^{2}-3 b c \,e^{2} f g +c^{2} d^{2} g^{2}+c^{2} d e f g +c^{2} e^{2} f^{2}\right ) x^{3}}{3 e^{3} g^{3}}+\frac {c^{2} \left (3 b e g -c d g -c e f \right ) x^{4}}{4 e^{2} g^{2}}+\frac {\left (a^{3} g^{6}-3 a^{2} b f \,g^{5}+3 a^{2} c \,f^{2} g^{4}+3 a \,b^{2} f^{2} g^{4}-6 a b c \,f^{3} g^{3}+3 a \,c^{2} f^{4} g^{2}-b^{3} f^{3} g^{3}+3 b^{2} c \,f^{4} g^{2}-3 b \,c^{2} f^{5} g +c^{3} f^{6}\right ) \ln \left (g x +f \right )}{g^{6} \left (d g -e f \right )}-\frac {\left (a^{3} e^{6}-3 a^{2} b d \,e^{5}+3 a^{2} c \,d^{2} e^{4}+3 a \,b^{2} d^{2} e^{4}-6 a b c \,d^{3} e^{3}+3 a \,c^{2} d^{4} e^{2}-b^{3} d^{3} e^{3}+3 b^{2} c \,d^{4} e^{2}-3 b \,c^{2} d^{5} e +c^{3} d^{6}\right ) \ln \left (e x +d \right )}{\left (d g -e f \right ) e^{6}}\) \(837\)
default \(\frac {3 a \,c^{2} d^{2} e^{2} g^{4} x +3 a \,c^{2} e^{4} f^{2} g^{2} x -6 a b c \,e^{4} f \,g^{3} x +3 a \,c^{2} d \,e^{3} f \,g^{3} x +3 b^{2} c d \,e^{3} f \,g^{3} x +c^{3} d^{4} g^{4} x +c^{3} e^{4} f^{4} x +\frac {1}{2} b^{3} e^{4} g^{4} x^{2}+\frac {1}{5} c^{3} x^{5} e^{4} g^{4}+a \,c^{2} e^{4} g^{4} x^{3}+b^{2} c \,e^{4} g^{4} x^{3}+3 b^{2} c \,d^{2} e^{2} g^{4} x +3 a b c \,e^{4} g^{4} x^{2}-\frac {3}{2} a \,c^{2} d \,e^{3} g^{4} x^{2}-\frac {3}{2} a \,c^{2} e^{4} f \,g^{3} x^{2}-\frac {3}{2} b^{2} c d \,e^{3} g^{4} x^{2}-\frac {3}{2} b^{2} c \,e^{4} f \,g^{3} x^{2}+\frac {3}{2} b \,c^{2} d^{2} e^{2} g^{4} x^{2}+\frac {3}{2} b \,c^{2} e^{4} f^{2} g^{2} x^{2}-\frac {1}{2} c^{3} d^{2} e^{2} f \,g^{3} x^{2}-\frac {1}{2} c^{3} d \,e^{3} f^{2} g^{2} x^{2}-3 b \,c^{2} d^{2} e^{2} f \,g^{3} x -3 b \,c^{2} d \,e^{3} f^{2} g^{2} x -6 a b c d \,e^{3} g^{4} x +\frac {3}{2} b \,c^{2} d \,e^{3} f \,g^{3} x^{2}-b \,c^{2} d \,e^{3} g^{4} x^{3}-b \,c^{2} e^{4} f \,g^{3} x^{3}+\frac {3}{4} b \,c^{2} e^{4} g^{4} x^{4}-\frac {1}{4} c^{3} d \,e^{3} g^{4} x^{4}-\frac {1}{4} c^{3} e^{4} f \,g^{3} x^{4}+\frac {1}{3} c^{3} d^{2} e^{2} g^{4} x^{3}+\frac {1}{3} c^{3} e^{4} f^{2} g^{2} x^{3}-\frac {1}{2} c^{3} d^{3} e \,g^{4} x^{2}-\frac {1}{2} c^{3} e^{4} f^{3} g \,x^{2}+3 a^{2} c \,e^{4} g^{4} x +\frac {1}{3} c^{3} d \,e^{3} f \,g^{3} x^{3}+3 b^{2} c \,e^{4} f^{2} g^{2} x -3 b \,c^{2} d^{3} e \,g^{4} x -3 b \,c^{2} e^{4} f^{3} g x +c^{3} d^{3} e f \,g^{3} x +c^{3} d^{2} e^{2} f^{2} g^{2} x +c^{3} d \,e^{3} f^{3} g x +3 a \,b^{2} e^{4} g^{4} x -b^{3} d \,e^{3} g^{4} x -b^{3} e^{4} f \,g^{3} x}{e^{5} g^{5}}+\frac {\left (-a^{3} e^{6}+3 a^{2} b d \,e^{5}-3 a^{2} c \,d^{2} e^{4}-3 a \,b^{2} d^{2} e^{4}+6 a b c \,d^{3} e^{3}-3 a \,c^{2} d^{4} e^{2}+b^{3} d^{3} e^{3}-3 b^{2} c \,d^{4} e^{2}+3 b \,c^{2} d^{5} e -c^{3} d^{6}\right ) \ln \left (e x +d \right )}{e^{6} \left (d g -e f \right )}+\frac {\left (a^{3} g^{6}-3 a^{2} b f \,g^{5}+3 a^{2} c \,f^{2} g^{4}+3 a \,b^{2} f^{2} g^{4}-6 a b c \,f^{3} g^{3}+3 a \,c^{2} f^{4} g^{2}-b^{3} f^{3} g^{3}+3 b^{2} c \,f^{4} g^{2}-3 b \,c^{2} f^{5} g +c^{3} f^{6}\right ) \ln \left (g x +f \right )}{g^{6} \left (d g -e f \right )}\) \(940\)
parallelrisch \(\text {Expression too large to display}\) \(1082\)
risch \(\text {Expression too large to display}\) \(1262\)

[In]

int((c*x^2+b*x+a)^3/(e*x+d)/(g*x+f),x,method=_RETURNVERBOSE)

[Out]

(3*a^2*c*e^4*g^4+3*a*b^2*e^4*g^4-6*a*b*c*d*e^3*g^4-6*a*b*c*e^4*f*g^3+3*a*c^2*d^2*e^2*g^4+3*a*c^2*d*e^3*f*g^3+3
*a*c^2*e^4*f^2*g^2-b^3*d*e^3*g^4-b^3*e^4*f*g^3+3*b^2*c*d^2*e^2*g^4+3*b^2*c*d*e^3*f*g^3+3*b^2*c*e^4*f^2*g^2-3*b
*c^2*d^3*e*g^4-3*b*c^2*d^2*e^2*f*g^3-3*b*c^2*d*e^3*f^2*g^2-3*b*c^2*e^4*f^3*g+c^3*d^4*g^4+c^3*d^3*e*f*g^3+c^3*d
^2*e^2*f^2*g^2+c^3*d*e^3*f^3*g+c^3*e^4*f^4)/e^5/g^5*x+1/5*c^3*x^5/e/g+1/2/e^4/g^4*(6*a*b*c*e^3*g^3-3*a*c^2*d*e
^2*g^3-3*a*c^2*e^3*f*g^2+b^3*e^3*g^3-3*b^2*c*d*e^2*g^3-3*b^2*c*e^3*f*g^2+3*b*c^2*d^2*e*g^3+3*b*c^2*d*e^2*f*g^2
+3*b*c^2*e^3*f^2*g-c^3*d^3*g^3-c^3*d^2*e*f*g^2-c^3*d*e^2*f^2*g-c^3*e^3*f^3)*x^2+1/3*c/e^3/g^3*(3*a*c*e^2*g^2+3
*b^2*e^2*g^2-3*b*c*d*e*g^2-3*b*c*e^2*f*g+c^2*d^2*g^2+c^2*d*e*f*g+c^2*e^2*f^2)*x^3+1/4*c^2/e^2/g^2*(3*b*e*g-c*d
*g-c*e*f)*x^4+1/g^6*(a^3*g^6-3*a^2*b*f*g^5+3*a^2*c*f^2*g^4+3*a*b^2*f^2*g^4-6*a*b*c*f^3*g^3+3*a*c^2*f^4*g^2-b^3
*f^3*g^3+3*b^2*c*f^4*g^2-3*b*c^2*f^5*g+c^3*f^6)/(d*g-e*f)*ln(g*x+f)-(a^3*e^6-3*a^2*b*d*e^5+3*a^2*c*d^2*e^4+3*a
*b^2*d^2*e^4-6*a*b*c*d^3*e^3+3*a*c^2*d^4*e^2-b^3*d^3*e^3+3*b^2*c*d^4*e^2-3*b*c^2*d^5*e+c^3*d^6)/(d*g-e*f)/e^6*
ln(e*x+d)

Fricas [A] (verification not implemented)

none

Time = 2.80 (sec) , antiderivative size = 736, normalized size of antiderivative = 1.39 \[ \int \frac {\left (a+b x+c x^2\right )^3}{(d+e x) (f+g x)} \, dx=\frac {60 \, {\left (c^{3} d^{6} - 3 \, b c^{2} d^{5} e - 3 \, a^{2} b d e^{5} + a^{3} e^{6} + 3 \, {\left (b^{2} c + a c^{2}\right )} d^{4} e^{2} - {\left (b^{3} + 6 \, a b c\right )} d^{3} e^{3} + 3 \, {\left (a b^{2} + a^{2} c\right )} d^{2} e^{4}\right )} g^{6} \log \left (e x + d\right ) + 12 \, {\left (c^{3} e^{6} f g^{5} - c^{3} d e^{5} g^{6}\right )} x^{5} - 15 \, {\left (c^{3} e^{6} f^{2} g^{4} - 3 \, b c^{2} e^{6} f g^{5} - {\left (c^{3} d^{2} e^{4} - 3 \, b c^{2} d e^{5}\right )} g^{6}\right )} x^{4} + 20 \, {\left (c^{3} e^{6} f^{3} g^{3} - 3 \, b c^{2} e^{6} f^{2} g^{4} + 3 \, {\left (b^{2} c + a c^{2}\right )} e^{6} f g^{5} - {\left (c^{3} d^{3} e^{3} - 3 \, b c^{2} d^{2} e^{4} + 3 \, {\left (b^{2} c + a c^{2}\right )} d e^{5}\right )} g^{6}\right )} x^{3} - 30 \, {\left (c^{3} e^{6} f^{4} g^{2} - 3 \, b c^{2} e^{6} f^{3} g^{3} + 3 \, {\left (b^{2} c + a c^{2}\right )} e^{6} f^{2} g^{4} - {\left (b^{3} + 6 \, a b c\right )} e^{6} f g^{5} - {\left (c^{3} d^{4} e^{2} - 3 \, b c^{2} d^{3} e^{3} + 3 \, {\left (b^{2} c + a c^{2}\right )} d^{2} e^{4} - {\left (b^{3} + 6 \, a b c\right )} d e^{5}\right )} g^{6}\right )} x^{2} + 60 \, {\left (c^{3} e^{6} f^{5} g - 3 \, b c^{2} e^{6} f^{4} g^{2} + 3 \, {\left (b^{2} c + a c^{2}\right )} e^{6} f^{3} g^{3} - {\left (b^{3} + 6 \, a b c\right )} e^{6} f^{2} g^{4} + 3 \, {\left (a b^{2} + a^{2} c\right )} e^{6} f g^{5} - {\left (c^{3} d^{5} e - 3 \, b c^{2} d^{4} e^{2} + 3 \, {\left (b^{2} c + a c^{2}\right )} d^{3} e^{3} - {\left (b^{3} + 6 \, a b c\right )} d^{2} e^{4} + 3 \, {\left (a b^{2} + a^{2} c\right )} d e^{5}\right )} g^{6}\right )} x - 60 \, {\left (c^{3} e^{6} f^{6} - 3 \, b c^{2} e^{6} f^{5} g - 3 \, a^{2} b e^{6} f g^{5} + a^{3} e^{6} g^{6} + 3 \, {\left (b^{2} c + a c^{2}\right )} e^{6} f^{4} g^{2} - {\left (b^{3} + 6 \, a b c\right )} e^{6} f^{3} g^{3} + 3 \, {\left (a b^{2} + a^{2} c\right )} e^{6} f^{2} g^{4}\right )} \log \left (g x + f\right )}{60 \, {\left (e^{7} f g^{6} - d e^{6} g^{7}\right )}} \]

[In]

integrate((c*x^2+b*x+a)^3/(e*x+d)/(g*x+f),x, algorithm="fricas")

[Out]

1/60*(60*(c^3*d^6 - 3*b*c^2*d^5*e - 3*a^2*b*d*e^5 + a^3*e^6 + 3*(b^2*c + a*c^2)*d^4*e^2 - (b^3 + 6*a*b*c)*d^3*
e^3 + 3*(a*b^2 + a^2*c)*d^2*e^4)*g^6*log(e*x + d) + 12*(c^3*e^6*f*g^5 - c^3*d*e^5*g^6)*x^5 - 15*(c^3*e^6*f^2*g
^4 - 3*b*c^2*e^6*f*g^5 - (c^3*d^2*e^4 - 3*b*c^2*d*e^5)*g^6)*x^4 + 20*(c^3*e^6*f^3*g^3 - 3*b*c^2*e^6*f^2*g^4 +
3*(b^2*c + a*c^2)*e^6*f*g^5 - (c^3*d^3*e^3 - 3*b*c^2*d^2*e^4 + 3*(b^2*c + a*c^2)*d*e^5)*g^6)*x^3 - 30*(c^3*e^6
*f^4*g^2 - 3*b*c^2*e^6*f^3*g^3 + 3*(b^2*c + a*c^2)*e^6*f^2*g^4 - (b^3 + 6*a*b*c)*e^6*f*g^5 - (c^3*d^4*e^2 - 3*
b*c^2*d^3*e^3 + 3*(b^2*c + a*c^2)*d^2*e^4 - (b^3 + 6*a*b*c)*d*e^5)*g^6)*x^2 + 60*(c^3*e^6*f^5*g - 3*b*c^2*e^6*
f^4*g^2 + 3*(b^2*c + a*c^2)*e^6*f^3*g^3 - (b^3 + 6*a*b*c)*e^6*f^2*g^4 + 3*(a*b^2 + a^2*c)*e^6*f*g^5 - (c^3*d^5
*e - 3*b*c^2*d^4*e^2 + 3*(b^2*c + a*c^2)*d^3*e^3 - (b^3 + 6*a*b*c)*d^2*e^4 + 3*(a*b^2 + a^2*c)*d*e^5)*g^6)*x -
 60*(c^3*e^6*f^6 - 3*b*c^2*e^6*f^5*g - 3*a^2*b*e^6*f*g^5 + a^3*e^6*g^6 + 3*(b^2*c + a*c^2)*e^6*f^4*g^2 - (b^3
+ 6*a*b*c)*e^6*f^3*g^3 + 3*(a*b^2 + a^2*c)*e^6*f^2*g^4)*log(g*x + f))/(e^7*f*g^6 - d*e^6*g^7)

Sympy [F(-1)]

Timed out. \[ \int \frac {\left (a+b x+c x^2\right )^3}{(d+e x) (f+g x)} \, dx=\text {Timed out} \]

[In]

integrate((c*x**2+b*x+a)**3/(e*x+d)/(g*x+f),x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 721, normalized size of antiderivative = 1.36 \[ \int \frac {\left (a+b x+c x^2\right )^3}{(d+e x) (f+g x)} \, dx=\frac {{\left (c^{3} d^{6} - 3 \, b c^{2} d^{5} e - 3 \, a^{2} b d e^{5} + a^{3} e^{6} + 3 \, {\left (b^{2} c + a c^{2}\right )} d^{4} e^{2} - {\left (b^{3} + 6 \, a b c\right )} d^{3} e^{3} + 3 \, {\left (a b^{2} + a^{2} c\right )} d^{2} e^{4}\right )} \log \left (e x + d\right )}{e^{7} f - d e^{6} g} - \frac {{\left (c^{3} f^{6} - 3 \, b c^{2} f^{5} g - 3 \, a^{2} b f g^{5} + a^{3} g^{6} + 3 \, {\left (b^{2} c + a c^{2}\right )} f^{4} g^{2} - {\left (b^{3} + 6 \, a b c\right )} f^{3} g^{3} + 3 \, {\left (a b^{2} + a^{2} c\right )} f^{2} g^{4}\right )} \log \left (g x + f\right )}{e f g^{6} - d g^{7}} + \frac {12 \, c^{3} e^{4} g^{4} x^{5} - 15 \, {\left (c^{3} e^{4} f g^{3} + {\left (c^{3} d e^{3} - 3 \, b c^{2} e^{4}\right )} g^{4}\right )} x^{4} + 20 \, {\left (c^{3} e^{4} f^{2} g^{2} + {\left (c^{3} d e^{3} - 3 \, b c^{2} e^{4}\right )} f g^{3} + {\left (c^{3} d^{2} e^{2} - 3 \, b c^{2} d e^{3} + 3 \, {\left (b^{2} c + a c^{2}\right )} e^{4}\right )} g^{4}\right )} x^{3} - 30 \, {\left (c^{3} e^{4} f^{3} g + {\left (c^{3} d e^{3} - 3 \, b c^{2} e^{4}\right )} f^{2} g^{2} + {\left (c^{3} d^{2} e^{2} - 3 \, b c^{2} d e^{3} + 3 \, {\left (b^{2} c + a c^{2}\right )} e^{4}\right )} f g^{3} + {\left (c^{3} d^{3} e - 3 \, b c^{2} d^{2} e^{2} + 3 \, {\left (b^{2} c + a c^{2}\right )} d e^{3} - {\left (b^{3} + 6 \, a b c\right )} e^{4}\right )} g^{4}\right )} x^{2} + 60 \, {\left (c^{3} e^{4} f^{4} + {\left (c^{3} d e^{3} - 3 \, b c^{2} e^{4}\right )} f^{3} g + {\left (c^{3} d^{2} e^{2} - 3 \, b c^{2} d e^{3} + 3 \, {\left (b^{2} c + a c^{2}\right )} e^{4}\right )} f^{2} g^{2} + {\left (c^{3} d^{3} e - 3 \, b c^{2} d^{2} e^{2} + 3 \, {\left (b^{2} c + a c^{2}\right )} d e^{3} - {\left (b^{3} + 6 \, a b c\right )} e^{4}\right )} f g^{3} + {\left (c^{3} d^{4} - 3 \, b c^{2} d^{3} e + 3 \, {\left (b^{2} c + a c^{2}\right )} d^{2} e^{2} - {\left (b^{3} + 6 \, a b c\right )} d e^{3} + 3 \, {\left (a b^{2} + a^{2} c\right )} e^{4}\right )} g^{4}\right )} x}{60 \, e^{5} g^{5}} \]

[In]

integrate((c*x^2+b*x+a)^3/(e*x+d)/(g*x+f),x, algorithm="maxima")

[Out]

(c^3*d^6 - 3*b*c^2*d^5*e - 3*a^2*b*d*e^5 + a^3*e^6 + 3*(b^2*c + a*c^2)*d^4*e^2 - (b^3 + 6*a*b*c)*d^3*e^3 + 3*(
a*b^2 + a^2*c)*d^2*e^4)*log(e*x + d)/(e^7*f - d*e^6*g) - (c^3*f^6 - 3*b*c^2*f^5*g - 3*a^2*b*f*g^5 + a^3*g^6 +
3*(b^2*c + a*c^2)*f^4*g^2 - (b^3 + 6*a*b*c)*f^3*g^3 + 3*(a*b^2 + a^2*c)*f^2*g^4)*log(g*x + f)/(e*f*g^6 - d*g^7
) + 1/60*(12*c^3*e^4*g^4*x^5 - 15*(c^3*e^4*f*g^3 + (c^3*d*e^3 - 3*b*c^2*e^4)*g^4)*x^4 + 20*(c^3*e^4*f^2*g^2 +
(c^3*d*e^3 - 3*b*c^2*e^4)*f*g^3 + (c^3*d^2*e^2 - 3*b*c^2*d*e^3 + 3*(b^2*c + a*c^2)*e^4)*g^4)*x^3 - 30*(c^3*e^4
*f^3*g + (c^3*d*e^3 - 3*b*c^2*e^4)*f^2*g^2 + (c^3*d^2*e^2 - 3*b*c^2*d*e^3 + 3*(b^2*c + a*c^2)*e^4)*f*g^3 + (c^
3*d^3*e - 3*b*c^2*d^2*e^2 + 3*(b^2*c + a*c^2)*d*e^3 - (b^3 + 6*a*b*c)*e^4)*g^4)*x^2 + 60*(c^3*e^4*f^4 + (c^3*d
*e^3 - 3*b*c^2*e^4)*f^3*g + (c^3*d^2*e^2 - 3*b*c^2*d*e^3 + 3*(b^2*c + a*c^2)*e^4)*f^2*g^2 + (c^3*d^3*e - 3*b*c
^2*d^2*e^2 + 3*(b^2*c + a*c^2)*d*e^3 - (b^3 + 6*a*b*c)*e^4)*f*g^3 + (c^3*d^4 - 3*b*c^2*d^3*e + 3*(b^2*c + a*c^
2)*d^2*e^2 - (b^3 + 6*a*b*c)*d*e^3 + 3*(a*b^2 + a^2*c)*e^4)*g^4)*x)/(e^5*g^5)

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 953, normalized size of antiderivative = 1.79 \[ \int \frac {\left (a+b x+c x^2\right )^3}{(d+e x) (f+g x)} \, dx=\frac {{\left (c^{3} d^{6} - 3 \, b c^{2} d^{5} e + 3 \, b^{2} c d^{4} e^{2} + 3 \, a c^{2} d^{4} e^{2} - b^{3} d^{3} e^{3} - 6 \, a b c d^{3} e^{3} + 3 \, a b^{2} d^{2} e^{4} + 3 \, a^{2} c d^{2} e^{4} - 3 \, a^{2} b d e^{5} + a^{3} e^{6}\right )} \log \left ({\left | e x + d \right |}\right )}{e^{7} f - d e^{6} g} - \frac {{\left (c^{3} f^{6} - 3 \, b c^{2} f^{5} g + 3 \, b^{2} c f^{4} g^{2} + 3 \, a c^{2} f^{4} g^{2} - b^{3} f^{3} g^{3} - 6 \, a b c f^{3} g^{3} + 3 \, a b^{2} f^{2} g^{4} + 3 \, a^{2} c f^{2} g^{4} - 3 \, a^{2} b f g^{5} + a^{3} g^{6}\right )} \log \left ({\left | g x + f \right |}\right )}{e f g^{6} - d g^{7}} + \frac {12 \, c^{3} e^{4} g^{4} x^{5} - 15 \, c^{3} e^{4} f g^{3} x^{4} - 15 \, c^{3} d e^{3} g^{4} x^{4} + 45 \, b c^{2} e^{4} g^{4} x^{4} + 20 \, c^{3} e^{4} f^{2} g^{2} x^{3} + 20 \, c^{3} d e^{3} f g^{3} x^{3} - 60 \, b c^{2} e^{4} f g^{3} x^{3} + 20 \, c^{3} d^{2} e^{2} g^{4} x^{3} - 60 \, b c^{2} d e^{3} g^{4} x^{3} + 60 \, b^{2} c e^{4} g^{4} x^{3} + 60 \, a c^{2} e^{4} g^{4} x^{3} - 30 \, c^{3} e^{4} f^{3} g x^{2} - 30 \, c^{3} d e^{3} f^{2} g^{2} x^{2} + 90 \, b c^{2} e^{4} f^{2} g^{2} x^{2} - 30 \, c^{3} d^{2} e^{2} f g^{3} x^{2} + 90 \, b c^{2} d e^{3} f g^{3} x^{2} - 90 \, b^{2} c e^{4} f g^{3} x^{2} - 90 \, a c^{2} e^{4} f g^{3} x^{2} - 30 \, c^{3} d^{3} e g^{4} x^{2} + 90 \, b c^{2} d^{2} e^{2} g^{4} x^{2} - 90 \, b^{2} c d e^{3} g^{4} x^{2} - 90 \, a c^{2} d e^{3} g^{4} x^{2} + 30 \, b^{3} e^{4} g^{4} x^{2} + 180 \, a b c e^{4} g^{4} x^{2} + 60 \, c^{3} e^{4} f^{4} x + 60 \, c^{3} d e^{3} f^{3} g x - 180 \, b c^{2} e^{4} f^{3} g x + 60 \, c^{3} d^{2} e^{2} f^{2} g^{2} x - 180 \, b c^{2} d e^{3} f^{2} g^{2} x + 180 \, b^{2} c e^{4} f^{2} g^{2} x + 180 \, a c^{2} e^{4} f^{2} g^{2} x + 60 \, c^{3} d^{3} e f g^{3} x - 180 \, b c^{2} d^{2} e^{2} f g^{3} x + 180 \, b^{2} c d e^{3} f g^{3} x + 180 \, a c^{2} d e^{3} f g^{3} x - 60 \, b^{3} e^{4} f g^{3} x - 360 \, a b c e^{4} f g^{3} x + 60 \, c^{3} d^{4} g^{4} x - 180 \, b c^{2} d^{3} e g^{4} x + 180 \, b^{2} c d^{2} e^{2} g^{4} x + 180 \, a c^{2} d^{2} e^{2} g^{4} x - 60 \, b^{3} d e^{3} g^{4} x - 360 \, a b c d e^{3} g^{4} x + 180 \, a b^{2} e^{4} g^{4} x + 180 \, a^{2} c e^{4} g^{4} x}{60 \, e^{5} g^{5}} \]

[In]

integrate((c*x^2+b*x+a)^3/(e*x+d)/(g*x+f),x, algorithm="giac")

[Out]

(c^3*d^6 - 3*b*c^2*d^5*e + 3*b^2*c*d^4*e^2 + 3*a*c^2*d^4*e^2 - b^3*d^3*e^3 - 6*a*b*c*d^3*e^3 + 3*a*b^2*d^2*e^4
 + 3*a^2*c*d^2*e^4 - 3*a^2*b*d*e^5 + a^3*e^6)*log(abs(e*x + d))/(e^7*f - d*e^6*g) - (c^3*f^6 - 3*b*c^2*f^5*g +
 3*b^2*c*f^4*g^2 + 3*a*c^2*f^4*g^2 - b^3*f^3*g^3 - 6*a*b*c*f^3*g^3 + 3*a*b^2*f^2*g^4 + 3*a^2*c*f^2*g^4 - 3*a^2
*b*f*g^5 + a^3*g^6)*log(abs(g*x + f))/(e*f*g^6 - d*g^7) + 1/60*(12*c^3*e^4*g^4*x^5 - 15*c^3*e^4*f*g^3*x^4 - 15
*c^3*d*e^3*g^4*x^4 + 45*b*c^2*e^4*g^4*x^4 + 20*c^3*e^4*f^2*g^2*x^3 + 20*c^3*d*e^3*f*g^3*x^3 - 60*b*c^2*e^4*f*g
^3*x^3 + 20*c^3*d^2*e^2*g^4*x^3 - 60*b*c^2*d*e^3*g^4*x^3 + 60*b^2*c*e^4*g^4*x^3 + 60*a*c^2*e^4*g^4*x^3 - 30*c^
3*e^4*f^3*g*x^2 - 30*c^3*d*e^3*f^2*g^2*x^2 + 90*b*c^2*e^4*f^2*g^2*x^2 - 30*c^3*d^2*e^2*f*g^3*x^2 + 90*b*c^2*d*
e^3*f*g^3*x^2 - 90*b^2*c*e^4*f*g^3*x^2 - 90*a*c^2*e^4*f*g^3*x^2 - 30*c^3*d^3*e*g^4*x^2 + 90*b*c^2*d^2*e^2*g^4*
x^2 - 90*b^2*c*d*e^3*g^4*x^2 - 90*a*c^2*d*e^3*g^4*x^2 + 30*b^3*e^4*g^4*x^2 + 180*a*b*c*e^4*g^4*x^2 + 60*c^3*e^
4*f^4*x + 60*c^3*d*e^3*f^3*g*x - 180*b*c^2*e^4*f^3*g*x + 60*c^3*d^2*e^2*f^2*g^2*x - 180*b*c^2*d*e^3*f^2*g^2*x
+ 180*b^2*c*e^4*f^2*g^2*x + 180*a*c^2*e^4*f^2*g^2*x + 60*c^3*d^3*e*f*g^3*x - 180*b*c^2*d^2*e^2*f*g^3*x + 180*b
^2*c*d*e^3*f*g^3*x + 180*a*c^2*d*e^3*f*g^3*x - 60*b^3*e^4*f*g^3*x - 360*a*b*c*e^4*f*g^3*x + 60*c^3*d^4*g^4*x -
 180*b*c^2*d^3*e*g^4*x + 180*b^2*c*d^2*e^2*g^4*x + 180*a*c^2*d^2*e^2*g^4*x - 60*b^3*d*e^3*g^4*x - 360*a*b*c*d*
e^3*g^4*x + 180*a*b^2*e^4*g^4*x + 180*a^2*c*e^4*g^4*x)/(e^5*g^5)

Mupad [B] (verification not implemented)

Time = 13.43 (sec) , antiderivative size = 794, normalized size of antiderivative = 1.50 \[ \int \frac {\left (a+b x+c x^2\right )^3}{(d+e x) (f+g x)} \, dx=x^4\,\left (\frac {3\,b\,c^2}{4\,e\,g}-\frac {c^3\,\left (d\,g+e\,f\right )}{4\,e^2\,g^2}\right )-x^3\,\left (\frac {\left (d\,g+e\,f\right )\,\left (\frac {3\,b\,c^2}{e\,g}-\frac {c^3\,\left (d\,g+e\,f\right )}{e^2\,g^2}\right )}{3\,e\,g}-\frac {c\,\left (b^2+a\,c\right )}{e\,g}+\frac {c^3\,d\,f}{3\,e^2\,g^2}\right )+x^2\,\left (\frac {b^3+6\,a\,c\,b}{2\,e\,g}+\frac {\left (d\,g+e\,f\right )\,\left (\frac {\left (d\,g+e\,f\right )\,\left (\frac {3\,b\,c^2}{e\,g}-\frac {c^3\,\left (d\,g+e\,f\right )}{e^2\,g^2}\right )}{e\,g}-\frac {3\,c\,\left (b^2+a\,c\right )}{e\,g}+\frac {c^3\,d\,f}{e^2\,g^2}\right )}{2\,e\,g}-\frac {d\,f\,\left (\frac {3\,b\,c^2}{e\,g}-\frac {c^3\,\left (d\,g+e\,f\right )}{e^2\,g^2}\right )}{2\,e\,g}\right )+x\,\left (\frac {3\,a\,\left (b^2+a\,c\right )}{e\,g}-\frac {\left (d\,g+e\,f\right )\,\left (\frac {b^3+6\,a\,c\,b}{e\,g}+\frac {\left (d\,g+e\,f\right )\,\left (\frac {\left (d\,g+e\,f\right )\,\left (\frac {3\,b\,c^2}{e\,g}-\frac {c^3\,\left (d\,g+e\,f\right )}{e^2\,g^2}\right )}{e\,g}-\frac {3\,c\,\left (b^2+a\,c\right )}{e\,g}+\frac {c^3\,d\,f}{e^2\,g^2}\right )}{e\,g}-\frac {d\,f\,\left (\frac {3\,b\,c^2}{e\,g}-\frac {c^3\,\left (d\,g+e\,f\right )}{e^2\,g^2}\right )}{e\,g}\right )}{e\,g}+\frac {d\,f\,\left (\frac {\left (d\,g+e\,f\right )\,\left (\frac {3\,b\,c^2}{e\,g}-\frac {c^3\,\left (d\,g+e\,f\right )}{e^2\,g^2}\right )}{e\,g}-\frac {3\,c\,\left (b^2+a\,c\right )}{e\,g}+\frac {c^3\,d\,f}{e^2\,g^2}\right )}{e\,g}\right )+\frac {\ln \left (d+e\,x\right )\,\left (e^4\,\left (3\,c\,a^2\,d^2+3\,a\,b^2\,d^2\right )+e^2\,\left (3\,b^2\,c\,d^4+3\,a\,c^2\,d^4\right )-e^3\,\left (b^3\,d^3+6\,a\,c\,b\,d^3\right )+a^3\,e^6+c^3\,d^6-3\,a^2\,b\,d\,e^5-3\,b\,c^2\,d^5\,e\right )}{e^7\,f-d\,e^6\,g}+\frac {\ln \left (f+g\,x\right )\,\left (g^4\,\left (3\,c\,a^2\,f^2+3\,a\,b^2\,f^2\right )+g^2\,\left (3\,b^2\,c\,f^4+3\,a\,c^2\,f^4\right )-g^3\,\left (b^3\,f^3+6\,a\,c\,b\,f^3\right )+a^3\,g^6+c^3\,f^6-3\,a^2\,b\,f\,g^5-3\,b\,c^2\,f^5\,g\right )}{d\,g^7-e\,f\,g^6}+\frac {c^3\,x^5}{5\,e\,g} \]

[In]

int((a + b*x + c*x^2)^3/((f + g*x)*(d + e*x)),x)

[Out]

x^4*((3*b*c^2)/(4*e*g) - (c^3*(d*g + e*f))/(4*e^2*g^2)) - x^3*(((d*g + e*f)*((3*b*c^2)/(e*g) - (c^3*(d*g + e*f
))/(e^2*g^2)))/(3*e*g) - (c*(a*c + b^2))/(e*g) + (c^3*d*f)/(3*e^2*g^2)) + x^2*((b^3 + 6*a*b*c)/(2*e*g) + ((d*g
 + e*f)*(((d*g + e*f)*((3*b*c^2)/(e*g) - (c^3*(d*g + e*f))/(e^2*g^2)))/(e*g) - (3*c*(a*c + b^2))/(e*g) + (c^3*
d*f)/(e^2*g^2)))/(2*e*g) - (d*f*((3*b*c^2)/(e*g) - (c^3*(d*g + e*f))/(e^2*g^2)))/(2*e*g)) + x*((3*a*(a*c + b^2
))/(e*g) - ((d*g + e*f)*((b^3 + 6*a*b*c)/(e*g) + ((d*g + e*f)*(((d*g + e*f)*((3*b*c^2)/(e*g) - (c^3*(d*g + e*f
))/(e^2*g^2)))/(e*g) - (3*c*(a*c + b^2))/(e*g) + (c^3*d*f)/(e^2*g^2)))/(e*g) - (d*f*((3*b*c^2)/(e*g) - (c^3*(d
*g + e*f))/(e^2*g^2)))/(e*g)))/(e*g) + (d*f*(((d*g + e*f)*((3*b*c^2)/(e*g) - (c^3*(d*g + e*f))/(e^2*g^2)))/(e*
g) - (3*c*(a*c + b^2))/(e*g) + (c^3*d*f)/(e^2*g^2)))/(e*g)) + (log(d + e*x)*(e^4*(3*a*b^2*d^2 + 3*a^2*c*d^2) +
 e^2*(3*a*c^2*d^4 + 3*b^2*c*d^4) - e^3*(b^3*d^3 + 6*a*b*c*d^3) + a^3*e^6 + c^3*d^6 - 3*a^2*b*d*e^5 - 3*b*c^2*d
^5*e))/(e^7*f - d*e^6*g) + (log(f + g*x)*(g^4*(3*a*b^2*f^2 + 3*a^2*c*f^2) + g^2*(3*a*c^2*f^4 + 3*b^2*c*f^4) -
g^3*(b^3*f^3 + 6*a*b*c*f^3) + a^3*g^6 + c^3*f^6 - 3*a^2*b*f*g^5 - 3*b*c^2*f^5*g))/(d*g^7 - e*f*g^6) + (c^3*x^5
)/(5*e*g)